package com.sixth.volunteerservicesystem.Controller.ExamController.backExam;

import com.sixth.volunteerservicesystem.Dao.QuestionRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author Steve Jobs
 * @create 2021-01-11 1:02
 */
@Controller
public class DeleteSubjects {
    @Autowired
    QuestionRepository questionRepository;

    @RequestMapping("/delete/{id}")
    public String delete(@PathVariable("id") Integer id){
        questionRepository.deleteById(id);
        return "redirect:/backExamList";
    }
}
